<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>Title</title>
</head>
<script src="js/jquery-3.1.1.min.js" type="text/javascript"></script>
<body>
<form action="" method="post">
    标题：<input type="text" name="title" value="${news.title}"><br/>
    所属版块：<select name="blockid" id="blockid">
    <option>--请选择版块--</option>
    <c:forEach items="${blockList}" var="b">
        <option value="${b.blockid}">${b.blockName}</option>
    </c:forEach>
</select><br/>
    内容：<textarea name="context">${news.context}</textarea>
    <br/>
    <input type="submit" value="确认修改完毕">
</form>
</body>
</html>
<script>
    $(function () {
        //blockid对应的option为选中状态
        var bid =${news.block.blockid};
        $("#blockid [value=" + bid + "]").attr("selected", true);
    })
</script>